package org.shuma.goods.controller;

import org.shuma.goods.domain.vo.ProductOnAndDownLineVo;
import org.shuma.goods.service.ProductUpAndDownLineService;
import org.shuma.goods.utils.Result;
import org.shuma.user.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author : liuming
 * @date : 2024/6/18 下午2:10
 */
@Controller
@RestController
@RequestMapping("/goods")
public class ProductUpAndDownLineController {
    @Autowired
    private ProductUpAndDownLineService productUpAndDownLineService;
    @PutMapping("/online")
    public Result upLine(@RequestBody ProductOnAndDownLineVo productOnAndDownLineVo, @RequestAttribute("userInfo") UserVo userVo) {
        return productUpAndDownLineService.upLine(productOnAndDownLineVo, userVo);
    }
    @PutMapping("/downline")
    public Result downLine(@RequestBody ProductOnAndDownLineVo productOnAndDownLineVo, @RequestAttribute("userInfo") UserVo userVo) {
        return productUpAndDownLineService.downLine(productOnAndDownLineVo, userVo);
    }
}
